package com.anzia.stream;

import java.io.FileOutputStream;

/**
 *@ClassName com.anzia.stream.FileOutputStreamDemo
 *@Description
 *@Author Anzia.
 *@Date 2021/4/8 21:27
 *@Version 1.0
 **/
public class FileOutputStreamDemo {

    public static void main(String[] args) throws Exception {

        //创建文件字节输出流对象
        //在已有内容后面拼接
        //FileOutputStream fos = new FileOutputStream("test_out",true);
        FileOutputStream fos = new FileOutputStream("static\\test_out");

        //写入文件
        //fos.write(97);
        //fos.write('b');
        //fos.write('c');

        String string = "hello world";
        fos.write(string.getBytes());

        //关闭流
        fos.close();
        System.out.println("执行完毕！");

    }

}
